﻿using System.Collections.Generic;
using Document.Entities;
using Document.Providers;

namespace Document
{
    public class DocumentManager : IDocumentManager
    {
        private MagistersProvider magistersProvider;
        private PracticeSpecialistProvider practiceSpecialistProvider;

        #region Implementation of IDocument

        /// <summary>
        /// Parse xls document and return all student in Magisters book
        /// </summary>
        /// <param name="filePath">Path to file at the server</param>
        /// <returns>Student list</returns>
        public List<StudentInfo> GetMagisters(string filePath)
        {
            magistersProvider = new MagistersProvider(filePath);

            List<StudentInfo> returnModel = magistersProvider.Load();

            return returnModel;
        }

        /// <summary>
        /// Parse xls document and return all student in Practice Specialist book
        /// </summary>
        /// <param name="filePath">Path to file at the server</param>
        /// <returns>Student list</returns>
        public List<StudentInfo> GetPracticeSpecialist(string filePath)
        {
            practiceSpecialistProvider = new PracticeSpecialistProvider(filePath);

            List<StudentInfo> returnModel = practiceSpecialistProvider.Load();

            return returnModel;
        }

        #endregion
    }
}